import { DmgType, DmgTypeKey, UnitAttrStruct } from "../types/L_Type"
import { AdditDmgEffTypeKey } from "./AdditDmgEffectConfig"
import { XAbilityTypeKey } from "./XAbilityConfig"

//普通数值类型升级加成如下           例如奖励攻击力10点 当升级系数为5时 奖励(10*奖励系数*修正系数)点  修正系数由共通公式统一给定 基础值设定一个正常起始即可防止后期膨胀太严重

//部分升级攻击特效 升级X能力公式如下  例如upgradeFactor=2    当奖励升级系数为 1 2(1*2) 4(1*2*2) 8(1*2*2*2) 时可以获得更高等级的奖励
//                                 例如upgradeFactor=3    当奖励升级系数为 1 3(1*3) 9(1*3*3) 27(1*3*3*3) 时可以获得更高等级的奖励

export type RewardTypeKey='unitAttr' |'dtRes' |'dtEnh' |'money' |'dmgEffect' |'xAbility' 



type RewardContentType={name:string,desc:string,iconPath?:string,rare:number} & (
    {type:'unitAttr',baseData:Pick<UnitAttrStruct,'attrs'>} | {type:'dtRes',baseData:Pick<UnitAttrStruct,'dtRes'>} | {type:'dtEnh',baseData:Pick<UnitAttrStruct,'dtEnh'>} |
    {type:'money',baseData:number} | {type:'dmgEffect',baseData:AdditDmgEffTypeKey[],upgradeFactor:number} |
    {type:'xAbility',baseData:XAbilityTypeKey[],upgradeFactor:number}
)


export type RewardConfigAttr={
    name:string,
    desc?:string,
    type:RewardTypeKey,
} & RewardContentType

/**3选1 奖励配置 */
export const RewardConfigArr:RewardConfigAttr[]=[
    {
        name:"鬼魅",
        desc:"提高你的敏捷{x}点",
        rare:1, //稀有度1-5星级
        iconPath:"ReplaceableTextures\\CommandButtons\\BTNUltravision.blp",
        type:'unitAttr',
        baseData:{attrs:{agi:3}}
    },
    {
        name:"牛步",
        desc:"提高你的移动速度{x}点",
        rare:1,
        iconPath:"ReplaceableTextures\\CommandButtons\\BTNBerserk.blp",
        type:'unitAttr',
        baseData:{attrs:{mov:3}}
    },
    {
        name:"力大无穷",
        desc:"提高你的力量{x}点",
        rare:1,
        iconPath:"ReplaceableTextures\\CommandButtons\\BTNSteelMelee.blp",
        type:'unitAttr',
        baseData:{attrs:{str:5}}
    },
    {
        name:"坚韧",
        desc:"提高你的韧性{x}点",
        rare:1,
        type:'unitAttr',
        baseData:{attrs:{tena:5}}
    },
    {
        name:"坚韧",
        desc:"提高你的韧性{x}点",
        rare:1,
        type:'unitAttr',
        baseData:{attrs:{tena:5}}
    },
    {
        name:"火焰专精",
        desc:"提高你的火系伤害{x}点",
        rare:1,
        type:'dtEnh',
        baseData:{dtEnh:{fire:10}}
    },
    {
        name:"百毒不侵",
        desc:"提高你的毒系抗性{x}点",
        rare:1,
        type:'dtRes',
        baseData:{dtRes:{poison:10}}
    },
    {
        name:"雷电之刑",
        desc:"攻击时触发{x}雷电伤害-攻击特效描述会直接使用关联config",
        rare:3,
        type:'dmgEffect',
        baseData:['pyhLightningChain','pyhLightningChain'],
        upgradeFactor:2
    },
    {
        name:"拖刀计",
        desc:"闪避时提升{x}点攻击力-x能力描述会直接使用关联config",
        rare:2,
        type:'xAbility',
        baseData:['fleeAtkUp1','fleeAtkUp1'],
        upgradeFactor:2
    },
]


